package com.tms.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tms.springboot.base.pojo.PdTruckType;
import com.tms.springboot.mapper.PdTruckTypeMapper;
import com.tms.springboot.search.PdTruckTypeSearch;
import com.tms.springboot.service.PdTruckTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 车辆类型表 服务实现类
 * </p>
 *
 * @author cjj
 * @since 2023-06-14
 */
@Service
public class PdTruckTypeServiceImpl extends ServiceImpl<PdTruckTypeMapper, PdTruckType> implements PdTruckTypeService {

    @Autowired
    private PdTruckTypeMapper pdTruckTypeMapper;

    @Override
    public PageInfo<PdTruckType> truckTypePage(PdTruckTypeSearch pdTruckTypeSearch) throws Exception {
        PageHelper.startPage(pdTruckTypeSearch.getCurrentpage(), pdTruckTypeSearch.getPagesize());
        List<PdTruckType> pdTruckTypes = this.pdTruckTypeMapper.truckTypePage(pdTruckTypeSearch);
        PageInfo pageInfo = new PageInfo(pdTruckTypes);
        return pageInfo;
    }
}
